package com.zhuoyue.web.controller.system;

import java.util.List;

import com.zhuoyue.system.domain.TblAppMessage;
import com.zhuoyue.system.domain.vo.TblAppMessageVo;
import com.zhuoyue.system.service.ITblAppMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zhuoyue.common.core.controller.BaseController;
import com.zhuoyue.common.core.domain.AjaxResult;
import com.zhuoyue.common.utils.poi.ExcelUtil;
import com.zhuoyue.common.core.page.TableDataInfo;

/**
 * @author zhanghui
 */
@RestController
@RequestMapping("/system/appMessage")
public class TblAppMessageController extends BaseController {
    @Autowired
    private ITblAppMessageService tblAppMessageService;

    /**
     * 查询消息列表
     */
    @GetMapping("/systemMessage")
    public TableDataInfo list(TblAppMessage tblMessage) {
        startPage();
        List<TblAppMessageVo> list = tblAppMessageService.selectTblMessageList(tblMessage);
        return getDataTable(list);
    }

    @GetMapping("/systemMessage/export")
    public AjaxResult exportSystemMessage(TblAppMessage tblMessage, String fileName) {
        List<TblAppMessageVo> list = tblAppMessageService.selectTblMessageList(tblMessage);
        ExcelUtil<TblAppMessageVo> util = new ExcelUtil<>(TblAppMessageVo.class);
        return util.exportExcel(list, fileName);
    }
}
